import { LoginProxy } from "../../script/proxy/LoginProxy";
import { app } from "../../script/app/App";
import { bind } from "../../core/module/proxy/ProxyDecorator";
import { AccountProxy } from "../../script/proxy/AccountProxy";
import { UIBase } from "../../core/module/ui/UIBase";
import { SampleProxy } from "../../script/proxy/SampleProxy";
@bind(LoginProxy)
export class Login extends UIBase<LoginProxy> {
    onInit(): void {
        this._view.btnAccount.onClick(this, this._onAccountLoginClick)
        this._view.btnSample.onClick(this, this._onSampleClick)
    }

    onShow(): void {
        super.onShow()
        // 直接显示登录，后面再完善热更和加载流程
        this._view.c1 = 2
    }

    /**
     * 显示账号登录界面
     */
    private _onAccountLoginClick() {
        app.ui.show(AccountProxy)
    }

    /**
     * 显示示例界面
     */
    private async _onSampleClick() {
        app.res.loadAll('common')
        app.ui.show(SampleProxy)
    }
}